import Vue from 'vue'
// normalize.css 第三方包
import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n
// 全局样式
import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'
// 导入图标
import '@/icons' // icon
// 导航守卫
import '@/permission' // permission control

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
// Mockjs数据
if (process.env.NODE_ENV === 'production') {
  const { mockXHR } = require('../mock')
  mockXHR()
}

// 安装elementUI，配置语言包
Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI)

Vue.config.productionTip = false

let userInfo = {}
/*
userInfo = {
  name:'zs',
  age:20,
  info:{
    tel:'8888',
    teacher:{
      name:'wg',age:23
    }
  }
}
*/
setTimeout(() => {
  userInfo = {
    name: 'zs',
    age: 20,
    info: {
      tel: '8888',
      teacher: {
        name: 'wg', age: 23
      }
    }
  }
}, 400)
console.log(userInfo?.name)
console.log(userInfo?.age)
console.log(userInfo.info?.tel)
console.log(userInfo.info?.teacher?.name)
console.log(userInfo.info?.teacher?.age)
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
